import React,{ createContext } from "react";
import netease from '../pages/netease/Index'
import tencent from '../pages/tencent/Index'
import kugou from '../pages/kugou/Index'
import kuwo from '../pages/kuwo/Index'
import migu from '../pages/migu/Index'
import baidu from '../pages/baidu/Index'
import Index from "../pages/Index";

export const myContext = createContext({})

// 导航栏数据
const nav = [
    { path:'/', title:'LOGO', exact: true, component: Index, id:0 , url:require("../assets/image/logo.png")},
    { path: '/netease', title: '网易云音乐', exact: false, component: netease ,id:1},
    { path: '/tencent', title: 'QQ音乐', exact: false, component: tencent ,id:2 },
    { path: '/kugou', title: '酷狗音乐', exact: false, component: kugou  ,id:3},
    { path: '/kuwo', title: '酷我音乐', exact: false, component: kuwo  ,id:4},
    { path: '/migu', title: '咪咕音乐', exact: false, component: migu  ,id:5},
    { path: '/baidu', title: '百度音乐', exact: false, component: baidu ,id:6},
  ];
// 给多个组件传相同参数
export const Context = props=>{
    return (
        <myContext.Provider value={nav}> 
            {props.children} {/* 所有的子组件 */}
        </myContext.Provider>
    )
}